Visual Basic (Usage) | ![]() |
---|---|
Dim instance As EntityManager Dim value As T value = instance.GetNullEntity(Of T)() |
Type Parameters
- T
- The Entity subtype of the "null" entity to retrieve
Return Value
A "null" entity of the specified Entity subtypeThe null entity is a sentinel object that looks and behaves, for the most part, like a real entity instance. Every entity class defines its own "null entity" instance. When a query method must return an entity and it has no valid entity instance to return, it returns the null entity for the requested entity type instead. When a relation property should return a related entity instance and there is no such instance, it will return a null entity instead.
Only one instance of a null entity exists for any given entity type. You may use IUpdateNullEntity to set custom defaults for the null entity. Use EntityAspect.IsNullEntity to test whether an entity is the null entity.
Target Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family, Windows Vista, Windows Server 2008 family